@include("user.head")
	<!-- 公共头部 -->
	<div id="content_person">
	<div class="row">
	<div class="col-xs-3">
		@include("user.uc.navigation")
	</div>
	<div class="col-xs-9">
		@include("user.uc.verify_head")
		<div class="panel panel-default">
			<div class="panel-heading">
				<h3 class="panel-title">基本信息</h3>
			</div>
			<div class="panel-body">
				<div class="form-horizontal">
					<div class="form-group">
						<label for="inputName" class="col-xs-3 control-label no_padding_right">公司名称:</label>
						<div class="col-xs-6">
							<input class="form-control input_size" name="company_name" id="inputName" placeholder="" type="text">
						</div>
					</div>

					<div class="form-group">
						<label for="inputGroupCode" class="col-xs-3 control-label no_padding_right">组织机构代码:</label>
						<div class="col-xs-6">
							<input class="form-control input_size" name="group_code" id="inputGroupCode" placeholder="" type="text">
						</div>
					</div>

					<div class="form-group">
						<label for="select" class="col-xs-3 control-label">注册地址:</label>
						<div class="col-xs-6">
							<select class="form-control select_size selects" name="province" id="province">
								<option value="-1">请选择</option>
								@include("user.uc.province_option")
							</select>
							<select class="form-control select_size selects" name="city" id="city">
								<option value="-1">请选择</option>
							</select>
							<select class="form-control select_size selects" name="area" id="area">
								<option value="-1">请选择</option>
							</select>
						</div>
					</div>

					<div class="form-group">
						<label for="inputAddress" class="col-xs-3 control-label no_padding_right">详细地址:</label>
						<div class="col-xs-6">
							<input class="form-control input_size" name="address" id="inputAddress" placeholder="" type="text">
						</div>
					</div>

					<div class="form-group">
						<label for="inputZcode" class="col-xs-3 control-label no_padding_right">邮政编码:</label>
						<div class="col-xs-6">
							<input class="form-control input_size" name="zcode" id="inputZcode" placeholder="" type="text">
						</div>
					</div>

					<div class="form-group">
						<label for="inputFax" class="col-xs-3 control-label no_padding_right">传真号:</label>
						<div class="col-xs-6">
							<input class="form-control input_size" name="fax" id="inputFax" placeholder="" type="text">
						</div>
					</div>


					<div class="form-group">
						<label for="inputContactPerson" class="col-xs-3 control-label no_padding_right">联系人:</label>
						<div class="col-xs-6">
							<input class="form-control input_size" name="contact_person" id="inputContactPerson" placeholder="" type="text">
						</div>
					</div>

					<div class="form-group">
						<label for="inputNumber" class="col-xs-3 control-label no_padding_right">联系人电话:</label>
						<div class="col-xs-6">
							<input class="form-control input_size" name="contact_number" id="inputNumber" placeholder="" type="text">
						</div>
					</div>

					<div class="form-group">
						<label for="inputEmail" class="col-xs-3 control-label no_padding_right">联系人邮箱:</label>
						<div class="col-xs-6">
							<input class="form-control input_size" name="email" id="inputEmail" placeholder="" type="text">
						</div>
					</div>

					<div class="form-group">
						<label for="inputEmail" class="col-xs-3 control-label no_padding_right">营业执照副本:</label>
						<div class="col-xs-6">
							<a href="javascript:;" class="file btn btn-primary">上传
								<input type="file" name="imgFile" id="copy">
								<input type="hidden" name="regist_copy" id="copyFileName">
							</a>
							<span id="copyName"></span>
						</div>
					</div>
					<div class="form-group">
						<label for="inputEmail" class="col-xs-3 control-label no_padding_right">LOGO:</label>
						<div class="col-xs-6">
							<a href="javascript:;" class="file btn btn-primary">上传
								<input type="file" name="imgFile" id="logo">
								<input type="hidden" name="logo" id="logoFileName">
							</a>
							<span id="logoName"></span>
						</div>
					</div>

					<div class="form-group">
				      <label class="col-xs-3 control-label no_padding_right">描述:</label>
				      <div class="col-xs-6">
				        <textarea class="form-control text_size" name="description" rows="3"></textarea>
				        <span class="help-block"></span>
				      </div>
				    </div>

					<div class="form-group">
						<label for="induction" class="col-xs-3 control-label no_padding_right">简介:</label>
						<div class="col-xs-9">
							<div id="container" style="height:500px;"></div>
						</div>
					</div>

					<div class="form-group">
						<div class="col-xs-12 text-center">
							<button type="button" id="sub" class="btn btn-primary">提交</button>
						</div>
				    </div>
				</div>
			</div>
		</div>
	</div>
	</div>
	</div>
	<!-- 公共底部 -->
	@include("user.footer")
	@include("user.common")
	<!-- 公共底部 -->

</body>
@include("user.uc.province_option_script")


<script type="text/javascript">
var ue = UE.getEditor('container');

$('#copy').AjaxFileUpload({
	path : "<% url('uc/user/upload') %>",
	onComplete : function(filename){
			$("#copyName").html(filename.filename);
			$("#copyFileName").val(filename.filename);
	}
});
$('#logo').AjaxFileUpload({
	path : "<% url('uc/user/upload') %>",
	onComplete : function(filename){
			$("#logoName").html(filename.filename);
			$("#logoFileName").val(filename.filename);
	}
});
$("#sub").bind("click", function(){
	var company_name = $("input[name='company_name']").val().trim();
	var group_code = $("input[name='group_code']").val().trim();
	var contact_person = $("input[name='contact_person']").val().trim();
	var contact_number = $("input[name='contact_number']").val().trim();
	var province = $("select[name='province']").val().trim();
	var city = $("select[name='city']").val().trim();
	var area = $("select[name='area']").val().trim();
	var address = $("input[name='address']").val().trim();
	var regist_copy = $("input[name='regist_copy']").val().trim();
	var logo = $("input[name='logo']").val().trim();
	var induction = encodeURIComponent(ue.getContent());
	var email = $("input[name='email']").val().trim();
	var zcode = $("input[name='zcode']").val().trim();
	var fax = $("input[name='fax']").val().trim();
	var description = $("textarea[name='description']").val().trim();

	if (company_name == '' || province < 1 || city < 1 || address == '' ||
		group_code == '' || contact_person == '' || contact_number == '' || email == '' || induction == '' || regist_copy == '' || logo == '')
	{
		warning('','必填信息不能为空');
		return false;
	}
	$.post("groupinfo_add", {
	company_name : company_name,
	province : province,
	city : city,
	area : area,
	address : address,
	contact_person : contact_person,
	contact_number : contact_number,
	email : email,
	group_code : group_code,
	regist_copy : regist_copy,
	induction : induction,
	fax : fax,
	zcode : zcode,
	logo : logo,
	description : description
	},function (data){
		if(data.success)
		{
			success("", "提交成功");
			setTimeout(function(){
				window.location.href="<%url('uc/profile')%>";
			}, 2000)
		}
	})
});
</script>
</html>